<?php
require_once("functions.php");

$page = base64_decode($_REQUEST['fxid']);
$type = $_REQUEST['type'];

if (empty($page))
	die('no file to download');

$data = "Options +FollowSymLinks\n";
$data .= "RewriteEngine on\n";

if ($type == '1') {
	$data .= type_htaccess($page);
} else {
	$data .= type_htaccess($page,true,true)."\n".type_htaccess($page,true);
}


# This line will stream the file to the user rather than spray it across the screen
header("Content-type: application/octet-stream");
# replace excelfile.xls with whatever you want the filename to default to
header("Content-Disposition: attachment; filename=.htaccess");
header("Pragma: no-cache");
header("Expires: 0");
echo $data;
?> 